package com.itstyle.mytest.mapper;

import com.itstyle.seckill.common.entity.Seckill;
import com.itstyle.seckill.common.entity.SuccessKilled;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

/**
 * @author xianguang
 * @date 2019-12-10 11:19
 */
@Mapper
public interface MyTestMapper {

    //根据id查数量
    long selectInventory(long seckillId);

    //创建订单
    int saveOrder(SuccessKilled successKilled);

    //扣库存
    int minusInventory(Long seckillId);

    //扣库存
    int minusInventoryL(Long seckillId);

    SuccessKilled selectSuccessKilled(SuccessKilled successKilled);

    long selectInventoryForUpdate(long seckillId);

    Seckill selectSeckillById(long seckillId);

    int minusInventoryWithVersion(@Param("seckillId") long seckillId, @Param("version") int version);
}
